<?php
$arr = array();
$num = 300000;
for ($i = $num; $i > 0; $i--)
	$arr[] = rand(0,10000000);
$beg = time();
asort($arr);
/*
for ($i = 0; $i < $num; $i++)
	for ($j = $i+1; $j < $num; $j++)
	if($arr[$i] > $arr[$j]) {
	$temp = $arr[$i];
	$arr[$i] = $arr[$j];
	$arr[$j] = $temp;
	}*/
$end = time();
echo 'Time: '.($end-$beg).'<br/>';

//for ($i = 0; $i < $num; $i++)
	//echo $i.'->'.$arr[$i].'<br/>';
reset($arr);
while ($i = each($arr)) echo $i[0].'->'.$i[1].'<br/>';